import { defHttp } from "/@/utils/http/axios";
import { useMessage } from "/@/hooks/web/useMessage";

const { createConfirm } = useMessage();

enum Api {
  list = '/settle/caishuiTaskSettle/list',
  itemList = '/settle/caishuiTaskSettle/itemList',
  handleImportList = '/settle/caishuiTaskSettle/handleImportList',
  statusOne='/settle/caishuiTaskSettle/statusOne',
  importExcel = '/settle/caishuiTaskSettle/importExcel',
  handleImportExcel = '/settle/caishuiTaskSettle/handleImportExcel',
  exportXls = '/settle/caishuiTaskSettle/exportXls',
  caishuiTaskSettleItemList = '/settle/caishuiTaskSettle/queryCaishuiTaskSettleItemByMainId',
  queryBusinessInfo = '/settle/caishuiTaskSettle/queryBusinessInfo',
}
/**
 * 导出api
 * @param params
 */
export const getExportUrl = Api.exportXls;

/**
 * 导入api
 */
export const getImportUrl = Api.importExcel;

/**
 * 导入api
 */
export const getHandleImportUrl = Api.handleImportExcel;

/**
 * 列表接口
 * @param params
 */
export const list = (params) => defHttp.get({url: Api.list, params});
/**
 * 详情列表接口
 * @param params
 */
export const itemList = (params) => defHttp.get({url: Api.itemList, params});

/**
 * 添加结算单列表
 * @param params
 */
export const handleImportList = (params) => defHttp.post({ url: Api.handleImportList, params }, { isTransformResponse: false });

/**
 * 提交、作废接口
 * @param params
 */
export const statusOne = (params) => {
  return defHttp.get({url: Api.statusOne, params}, {isTransformResponse:false});
}

/**
 * 子表列表接口
 * @param params
 */
export const taskSettleItemList = (params) => defHttp.get({url: Api.caishuiTaskSettleItemList, params},{isTransformResponse:false});

/**
 * 查询当前商户相关信息
 * @param params
 */
export const queryBusinessInfo = () => defHttp.get({url: Api.queryBusinessInfo});
